<!DOCTYPE html>
<html lang="zc-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        //使用组合继承的方式，继承父构造函数的属性和方法
        function Father(uname, age, gender) {
            this.uname = uname
            this.age = age
            this.gender = gender
        }

        Father.prototype.money = function () {
            console.log('赚了一个小目标')
        }


        function Son(uname, age, gender) {
            //改变this指向   继承父父构造函数的属性
            Father.call(this, uname, age, gender)
        }

        Son.prototype = new Father()
        Son.prototype.constructor = Son

        const son  = new Son('ikun','2.5','女')
        // console.log(Son.prototype);
        console.log(son);

    </script>
</body>

</html>